home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / lace.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  3.8 KB  |  119 lines

  1. " Vim syntax file
  2. " Language:        lace
  3. " Maintainer:    Jocelyn Fiat <utilities@eiffel.com>
  4. " Last change:    1998 March 25  
  5.  
  6. " Copyright Interactive Software Engineering, 1998
  7. " You are free to use this file as you please, but
  8. " if you make a change or improvement you must send
  9. " it to the maintainer at <utilities@eiffel.com>
  10.  
  11.  
  12. " Remove any old syntax stuff hanging around
  13. syn clear
  14.  
  15. " LACE is case insensitive, but the style guide lines are not.
  16.  
  17. if !exists("lace_case_insensitive")
  18.     syn case match
  19. else
  20.     syn case ignore
  21. endif
  22.  
  23. " A bunch of useful LACE keywords
  24. syn keyword laceTopStruct        system root default option visible cluster
  25. syn keyword laceTopStruct        external generate end
  26. syn keyword laceOptionClause    collect assertion debug optimize trace 
  27. syn keyword laceOptionClause    profile inline precompiled multithreaded 
  28. syn keyword laceOptionClause    exception_trace dead_code_removal 
  29. syn keyword laceOptionClause    array_optimization
  30. syn keyword laceOptionClause    inlining_size inlining
  31. syn keyword laceOptionMark        yes no all
  32. syn keyword laceOptionMark        require ensure invariant loop check 
  33. syn keyword laceClusterProp        use include exclude
  34. syn keyword laceAdaptClassName    adapt ignore rename as 
  35. syn keyword laceAdaptClassName    creation export visible
  36. syn keyword laceExternal        include_path object makefile
  37.  
  38. " Operators
  39. syn match   laceOperator        "\$"
  40. syn match   laceBrackets        "[[\]]"
  41. syn match   laceExport            "[{}]"
  42.  
  43. " Constants
  44. syn keyword laceBool        true false
  45. syn keyword laceBool        True False
  46. syn region  laceString        start=+"+ skip=+%"+ end=+"+ contains=laceEscape,laceStringError
  47. syn match   laceEscape        contained "%[^/]"
  48. syn match   laceEscape        contained "%/\d\+/"
  49. syn match   laceEscape        contained "^[ \t]*%"
  50. syn match   laceEscape        contained "%[ \t]*$"
  51. syn match   laceStringError    contained "%/[^0-9]"
  52. syn match   laceStringError    contained "%/\d\+[^0-9/]"
  53. syn match   laceStringError    "'\(%[^/]\|%/\d\+/\|[^'%]\)\+'"
  54. syn match   laceCharacter    "'\(%[^/]\|%/\d\+/\|[^'%]\)'" contains=laceEscape
  55. syn match   laceNumber        "-\=\<\d\+\(_\d\+\)*\>"
  56. syn match   laceNumber        "\<[01]\+[bB]\>"
  57. syn match   laceNumber        "-\=\<\d\+\(_\d\+\)*\.\(\d\+\(_\d\+\)*\)\=\([eE][-+]\=\d\+\(_\d\+\)*\)\="
  58. syn match   laceNumber        "-\=\.\d\+\(_\d\+\)*\([eE][-+]\=\d\+\(_\d\+\)*\)\="
  59. syn match   laceComment        "--.*" contains=laceTodo
  60.  
  61.  
  62. syn case match
  63.  
  64. " Case sensitive stuff
  65.  
  66. syn keyword laceTodo        TODO XXX FIXME
  67. syn match    laceClassName    "\<[A-Z][A-Z0-9_]*\>"
  68. syn match    laceCluster        "[a-zA-Z][a-zA-Z0-9_]*\s*:"
  69. syn match    laceCluster        "[a-zA-Z][a-zA-Z0-9_]*\s*(\s*[a-zA-Z][a-zA-Z0-9_]*\s*)\s*:"
  70.  
  71. " Catch mismatched parentheses
  72. syn match laceParenError    ")"
  73. syn match laceBracketError    "\]"
  74. syn region laceGeneric        transparent matchgroup=laceBrackets start="\[" end="\]" contains=ALLBUT,laceBracketError
  75. syn region laceParen        transparent start="(" end=")" contains=ALLBUT,laceParenError
  76.  
  77. " Should suffice for even very long strings and expressions
  78. syn sync lines=40
  79.  
  80. if !exists("did_lace_syntax_inits")
  81.   let did_lace_syntax_inits = 1
  82.   " The default methods for highlighting.  Can be overridden later
  83.   hi link laceTopStruct            PreProc
  84.  
  85.   hi link laceOptionClause        Statement
  86.   hi link laceOptionMark        Constant
  87.   hi link laceClusterProp        Label
  88.   hi link laceAdaptClassName    Label
  89.   hi link laceExternal            Statement
  90.   hi link laceCluster            ModeMsg
  91.  
  92.   hi link laceEscape            Special
  93.  
  94.   hi link laceBool                Boolean
  95.   hi link laceString            String
  96.   hi link laceCharacter            Character
  97.   hi link laceClassName            Type
  98.   hi link laceNumber            Number
  99.  
  100.   hi link laceOperator            Special
  101.   hi link laceArray                Special
  102.   hi link laceExport            Special
  103.   hi link laceCreation            Special
  104.   hi link laceBrackets            Special
  105.   hi link laceConstraint        Special
  106.  
  107.   hi link laceComment            Comment
  108.  
  109.   hi link laceError                Error
  110.   hi link laceStringError        Error
  111.   hi link laceParenError        Error
  112.   hi link laceBracketError        Error
  113.   hi link laceTodo                Todo
  114. endif
  115.  
  116. let b:current_syntax = "lace"
  117.  
  118. " vim: ts=4
  119.